<template>
  <view>userInfo</view>
</template>

<script>
  export default {
    name: "userInfo",
    data() {
      return {
        list: [],
      };
    },
    methods: {
      getInfo() {
        uni.request({
          url: "http://127.0.0.1:5500/static/data/data.json",
          method: "GET",
          data: {},
          success: (res) => {
            console.log(res);
            this.list = res.data;
            this.list.forEach((item, index) => {
              console.log(index, item.id, item.name);
            });
            console.log(res.data);
          },
          fail: () => {},
          complete: () => {},
        });
      },
    },
    created() {
      this.getInfo();
    },
  };
</script>

<style></style>
